
public class Maximum {
	
	public int maxProduct(int[] A) {
	       int count=A[0];
	       int last=count;//>0
	       int lastMin=count;//<0
	       
	       for(int i=1;i<A.length;i++){
	    	   if(A[i]<0)
	    		   last=count;
	    	   
	    	     count*=A[i];
	    	   
	    	     if(count<0){
	    	    	 lastMin=count;
	    	     }
	    	   }
	      return last;
    }
}
